<template>
  <tbc-dialog title="订单详情" ref="dialog" width="1100px" basic>
    <order-info-panel ref="info"/>
  </tbc-dialog>
</template>
<script lang="ts">
import {defineComponent, defineAsyncComponent, Ref, ref} from 'vue'

export default defineComponent({

  name: 'order-detail-dialog',

  components: {
    OrderInfoPanel: defineAsyncComponent(() =>
        import('./components/OrderDetailPanel.vue')
    )
  },

  setup() {

    const dialog: Ref = ref(null)
    const info: Ref = ref(null)
    const show = (data: { order_sn: string }): void => {
      dialog.value.show()
      console.log(data, '=============')
      setTimeout(() => info.value.init(data), 100)
    }

    const close = (): void => {
      dialog.value.close()
    }

    return {
      dialog,
      show,
      info,
      close
    }
  },
})
</script>
